<template>
<uni-shadow-root class="icon-index"><view class="icon" :style="'width: '+(size * 2)+'rpx;height: '+(size * 2)+'rpx'">
    <image :src="src" v-if="src !== ''"></image>
</view></uni-shadow-root>
</template>

<script>

global['__wxRoute'] = 'icon/index'
Component({
    externalClasses: ['icon-class'],

    properties: {
        // small || large || default
        size: {
            type: Number,
            value: 20
        },
        src: {
            type: String,
            value: ''
        }
    }
});
export default global['__wxComponents']['icon/index']
</script>
<style platform="mp-weixin">
.icon{display:inline-block;text-align:center;position:relative;overflow:hidden;vertical-align:middle}
.icon image{width:100%;height:100%}
</style>